//
//  HerosJiNengTableViewCell.m
//  LOLBOX
//
//  Created by lanou3g on 15/12/18.
//  Copyright © 2015年 张明. All rights reserved.
//

#import "HerosJiNengTableViewCell.h"

@implementation HerosJiNengTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self p_setView];
        
        [self resignFirstResponder] ;
    }
    return self;
}


-(void)p_setView{
    self.firstButton = [[UIImageView alloc] init];
    self.firstButton.frame = CGRectMake(10, 5, 40, 40);
    self.firstButton.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.firstButton];
    
    self.secondButton = [[UIImageView alloc] init];
    self.secondButton.frame = CGRectMake(60, 0, 40, 40);
    self.secondButton.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.secondButton];
    
    self.thirdButton = [[UIImageView alloc] init];
    self.thirdButton.frame = CGRectMake(110, 0, 40, 40);
    self.thirdButton.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.thirdButton];
    
    self.fourthButton = [[UIImageView alloc] init];
    self.fourthButton.frame = CGRectMake(160, 0, 40, 40);
    self.fourthButton.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.fourthButton];
    
    self.fifthButton = [[UIImageView alloc] init];
    self.fifthButton.frame = CGRectMake(210, 0, 40, 40);
    self.fifthButton.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.fifthButton];
    
    self.detaliLable = [[UILabel alloc] init];
    self.detaliLable.frame = CGRectMake(10, 50, self.frame.size.width-20, self.frame.size.height - 50);
    self.detaliLable.numberOfLines = 0;
    self.detaliLable.font = [UIFont systemFontOfSize:14];
    self.detaliLable.text = @" ";
    self.detaliLable.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.detaliLable];
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.firstButton.frame = CGRectMake(10, 5, 40, 40);
    self.secondButton.frame = CGRectMake(60, 5, 40, 40);
    self.thirdButton.frame = CGRectMake(110, 5, 40, 40);
    self.fourthButton.frame = CGRectMake(160, 5, 40, 40);
    self.fifthButton.frame = CGRectMake(210, 5, 40, 40);
    //  self.detaliLable.frame = CGRectMake(10, 50, self.frame.size.width-20, self.frame.size.height - 50);
}

-(CGFloat)getHetghtWithJiNeng:(NSString *)string{
    CGRect rect = [string boundingRectWithSize:CGSizeMake(self.frame.size.width, 2000) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName :[UIFont systemFontOfSize:15.0]} context:nil];
    self.detaliLable.frame = CGRectMake(10, 50, self.frame.size.width-20, rect.size.height);
    return rect.size.height;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}


@end
